/**
 * NEVER creat containers of auto_ptrs.
 *
 * "TO COPY AN AUTO_PTR IS TO CHANGE ITS VALUE"
 */

class widget {};

bool widget_ap_compare(const auto_ptr<widget>& lhs, const auto_ptr<widget>& rhs)
{
	return *lhs < *rhs;
}

/* this should NOT compile */
vector<auto_ptr<widget> > widgets;

sor

int main()
{
	auto_ptr<widget> pw1(new widget);

	/* pw2 points to pw1's widget, and pw1
	 * is set to NULL, ownership of the widget
	 * is transferred from pw1 to pw2
	 */
	auto_ptr<widget> pw2(pw1);

	/* pw1 now points to the widget again, pw2
	 * is set to NULL
	 */
	pw1 = pw2;
	
	return 0;
}
